package com.step.ems.common

import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext

object Util {
    @Composable
    fun changeStatusBar(dark: Boolean) {
        val context = LocalContext.current as ComponentActivity
        val statusBarStyle =
            if (dark) SystemBarStyle.dark(android.graphics.Color.TRANSPARENT)
            else SystemBarStyle.light(
                android.graphics.Color.TRANSPARENT,
                android.graphics.Color.TRANSPARENT
            )
        context.enableEdgeToEdge(statusBarStyle = statusBarStyle)
    }
}